<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="" method="get">
        <label for="uname">
            用户名
            <input id="uname" type="text">
        </label>
        <label for="upass">
            密码s
            <input id="upass" type="password">
        </label>

        <button>登录</button>
    </form>
    <script>
        var uname = document.querySelector('#uname')
        var upass = document.querySelector('#upass')
        var button = document.querySelector('button')
        console.log(uname,upass,button);
        button.onclick=function(){
            // console.log(uname.value);
            // var obj = {"username":uname.value,"password":upass.value}

            window.open('http://localhost:3001/login?username='+uname.value.trim()+'&password='+upass.value.trim(),'_self')
            return false
        }

    </script>
    <!-- <script src="./登录作业.js"></script> -->
</body>
</html>